Listeners

您所在的位置:网站首页 oracle listener does not Listeners

Listeners

#Listeners| 来源: 网络整理| 查看: 265

Amazon VPC Lattice is in preview release and is subject to change.

Listeners

Before you start using your VPC Lattice service, you must add one or more listeners. A listener is a process that checks for connection requests, using the protocol and port that you configure. The rules that you define for a listener determine how the service routes requests to its registered targets.

Contents

Listener configurationListener rulesHTTP listenersHTTPS listenersUpdate listenersDelete listeners Listener configuration

Listeners support the following protocols and ports:

Protocols: HTTP, HTTPS

Ports: 1-65535

If the listener protocol is HTTPS, VPC Lattice will provision and manage a TLS certificate that is associated with the VPC Lattice generated FQDN. VPC Lattice supports TLS on HTTP/1.1 and HTTP/2. When you configure a service with an HTTPS listener, VPC Lattice will automatically determine the HTTP protocol via Application-Layer Protocol Negotiation (ALPN). If ALPN is absent, VPC Lattice defaults to HTTP/1.1.

VPC Lattice can listen on HTTP, HTTPS, HTTP/1.1, and HTTP/2 and communicate to targets in any of these protocols and versions. These listener and target group configurations do not need to match. VPC Lattice manages the entire process of upgrading and downgrading between protocols and versions. For more information, see Protocol version.

VPC Lattice does not support WebSockets.

Listener rules

Each listener has a default rule and additional rules that you can define. Each rule consists of a priority, one or more actions, and one or more conditions. You can add or edit rules at any time.

Default rules

When you create a listener, you define actions for the default rule. Default rules can't have conditions. If the conditions for none of a listener's rules are met, then the action for the default rule is performed.

Rule priority

Each rule has a priority. Rules are evaluated in priority order, from the lowest value to the highest value. The default rule is evaluated last. You can change the priority of a non-default rule at any time. You cannot change the priority of the default rule.

Rule action

Listeners for VPC Lattice services support forward actions and fixed response actions.

Forward actions

You can use forward actions to route requests to one or more target groups. If you specify multiple target groups for a forward action, you must specify a weight for each target group. Each target group weight is a value from 0 to 999. Requests that match a listener rule with weighted target groups are distributed to these target groups based on their weights. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group.

Fixed-response actions

You can use fixed-response actions to drop client requests and return a custom HTTP response. You can use this action to return a 404 response code.

Example fixed response action for the AWS CLI

You can specify an action when you create or update a rule. The following action sends a fixed response with the specified status code.

{ "action": { "fixedResponse": { "statusCode": 404 }, Rule conditions

Each rule condition has a type and configuration information. When the conditions for a rule are met, then its actions are performed.

The following are the supported matching criteria for a rule:

Header match

Routing is based on the HTTP headers for each request. You can use HTTP header conditions to configure rules that route requests based on the HTTP headers for the request. You can specify the names of standard or custom HTTP header fields. The header name and the match evaluation are not case sensitive. You can change this setting by turning on case-sensitivity. Wildcard characters are not supported in the header name. Prefix, exact, and contains matching are supported on header match.

Method match

Routing is based on the HTTP request method of each request.

You can use HTTP request method conditions to configure rules that route requests based on the HTTP request method of the request. You can specify standard or custom HTTP methods. The method match is case sensitive. The method name must be an exact match. Wildcard characters are not supported.

Path match

Routing is based on matching the path patterns in the request URLs.

You can use path conditions to define rules that route requests based on the URL in the request. Wildcard characters are not supported. Prefix and exact matching on path are supported.

Add a rule

You can add rules to a listener any time while creating or after you create the listener.

To add a listener rule after the listener is created using the console

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, under VPC Lattice, choose Service.

On the Service page, search for the service name, and select it to see its details.

Open the Routing tab, and choose Edit.

Under Listener rules, choose Add rule.

To add a path match condition, choose Add condition, Path and enter the path pattern. The maximum size of each string is 200 characters. The comparison is not case sensitive. Wildcard characters are not supported. Method match and header match are two other rule conditions that are supported using the AWS CLI.

Review your updates, and choose Edit.

To add a rule using the AWS CLI

Use the create-rule command.

Update a rule

You can update the listener rule at any time. You can modify the rule priority, rule condition, the target group for default action, and the weight of the target group. However, you can't modify the rule name after the listener is created.

To update a listener rule using the console

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, under VPC Lattice, choose Service.

On the Service page, search for the service name, and select it to see its details.

Open the Routing tab, and choose Edit.

For Rule, modify the rule priority, rule condition, the target group for default action, or the weight of the target group as required.

Review your updates, and choose Edit.

To update a rule using the AWS CLI

Use the update-rule command.

Delete a rule

You can delete the non-default rules for a listener at any time. You cannot delete the default rule for a listener. When you delete a listener, all of its rules are deleted.

To delete a listener rule using the console

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, under VPC Lattice, choose Service.

On the Service page, search for the service name, and select it to see its details.

Open the Routing tab, and choose Edit.

On the Edit Listener page, go to the rule that you want to delete, and choose Remove.

Review your updates, and choose Edit.

To delete a rule using the AWS CLI

Use the delete-rule command.

Update a listener

After you create an HTTP or HTTPS listener, you can replace the target group that it points to, or add additional target groups and assign different weights to those target groups. You can also add or replace listener rules. However, you can't edit the listener name or its protocol and port after it is created.

To update an HTTP or HTTPS listener using the console

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, under VPC Lattice, choose Service.

On the Service page, search for the service name, and select it to see its details.

Open the Routing tab, and choose Edit.

For Default action, edit the target group or its weight as required.

To add additional target groups, choose Add action.

For Rule, you can modify the rule priority, rule condition, the target group for default action, and the weight of the target group. However, you can't modify the rule name after the rule is created.

Review your updates, and choose Edit.

To update the listener using the AWS CLI

Use the update-listener command.

To update the listener rule, use the update-rule command.

Delete a listener

You can delete a listener at any time. When you delete a listener, all its rules are automatically deleted.

To delete a listener using the console

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, under VPC Lattice, choose Service.

On the Service page, search for the service name, and select it to see its details.

Open the Routing tab, and choose Delete.

When prompted for confirmation, enter confirm and then choose Delete.

To delete a listener using the AWS CLI

Use the delete-listener command.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3